#import "RedEnvelop.h"
#import <objc/runtime.h>

@implementation RedEnvelop

+ (void)setupAutoEnvelop
{
    [NSObject zh_swizzleClassWithName:@"QLVUserInfo" classPrefix:@"RG_" methodPrefix:@"a_"];
    [NSObject zh_swizzleClassWithName:@"QLVUserProfile" classPrefix:@"RG_" methodPrefix:@"a_"];
    [NSObject zh_swizzleClassWithName:@"QLVUserProfile" classPrefix:@"RG_" methodPrefix:@"b_"];
    [NSObject zh_swizzleClassWithName:@"QLVAppLogin" classPrefix:@"RG_" methodPrefix:@"a_"];
    [NSObject zh_swizzleClassWithName:@"QLVLoginCenter" classPrefix:@"RG_" methodPrefix:@"a_"];
}

@end

@implementation RG_QLVUserInfo

- (id)a_initWithLoginInfo:(id)arg1 userVipInfo:(id)arg2 {
    id obj = [self a_initWithLoginInfo:arg1 userVipInfo:arg2];
    return obj;
}

@end

@implementation RG_QLVUserProfile

- (void)b_setVipInfo:(QQVideoVipUserInfo *)vipInfo {
    if (vipInfo) {
        NSString *uin = [_vipInfo valueForKeyPath:@"jcev2_p_0_r_uin"];
        NSString *info = @"{\"annualbegintime\":0,\"annualendtime\":0,\"annualvip\":0,\"beginTime\":\"2017-10-18 19:01:24\",\"dailyscore\":10,\"endTime\":\"2028-03-22 19:01:24\",\"islevelup\":1,\"level\":3,\"levelupversion\":1520966622,\"nextgivedate\":0,\"qquvip\":{\"beginTime\":\"1970-01-01 08:00:00\",\"endTime\":\"1970-01-01 08:00:00\",\"vip\":0},\"result\":{\"code\":0,\"msg\":\"ok\"},\"score\":1800,\"servicetype\":\"TXSP\",\"uin\":%@,\"vip\":1}";
        [NSString stringWithFormat:@"%@%@", info, uin];
        [vipInfo setValue:@(3) forKeyPath:@"jcev2_p_4_o_level"];
        [vipInfo setValue:@(1) forKeyPath:@"jcev2_p_5_o_isAnnualVip"];
        [vipInfo setValue:@(1) forKeyPath:@"jcev2_p_15_o_isLevelUp"];
        [vipInfo setValue:@(1837335684) forKeyPath:@"jcev2_p_12_o_annualEndTime"];
        [vipInfo setValue:info forKeyPath:@"jcev2_p_7_o_jsonData"];
        [vipInfo setValue:@(1837335684) forKeyPath:@"jcev2_p_3_o_endTime"];
        [vipInfo setValue:@(1) forKeyPath:@"jcev2_p_1_r_isVip"];
        _vipInfo = vipInfo;
    }
}

- (QQVideoVipUserInfo *)a_vipInfo {
//    NSString *info = @"{\"annualbegintime\":0,\"annualendtime\":0,\"annualvip\":0,\"beginTime\":\"2017-10-18 19:01:24\",\"dailyscore\":10,\"endTime\":\"2028-03-22 19:01:24\",\"islevelup\":1,\"level\":3,\"levelupversion\":1520966622,\"nextgivedate\":0,\"qquvip\":{\"beginTime\":\"1970-01-01 08:00:00\",\"endTime\":\"1970-01-01 08:00:00\",\"vip\":0},\"result\":{\"code\":0,\"msg\":\"ok\"},\"score\":1800,\"servicetype\":\"TXSP\",\"uin\":363642022,\"vip\":1}";
//    if (_vipInfo) {
//        [_vipInfo setValue:@(3) forKeyPath:@"jcev2_p_4_o_level"];
//        [_vipInfo setValue:@(1) forKeyPath:@"jcev2_p_5_o_isAnnualVip"];
//        [_vipInfo setValue:@(1) forKeyPath:@"jcev2_p_15_o_isLevelUp"];
//        [_vipInfo setValue:@(1837335684) forKeyPath:@"jcev2_p_12_o_annualEndTime"];
//        [_vipInfo setValue:info forKeyPath:@"jcev2_p_7_o_jsonData"];
//        [_vipInfo setValue:@(1837335684) forKeyPath:@"jcev2_p_3_o_endTime"];
//        [_vipInfo setValue:@(1) forKeyPath:@"jcev2_p_1_r_isVip"];
//    }
    return _vipInfo;
}

@end

@implementation RG_QLVAppLogin

- (id)a_curUserInfo {
    id userInfo = [self a_curUserInfo];
    return userInfo;
}

@end

@implementation RG_QLVLoginCenter

- (void)a_loginInfoDidUpdate:(id)arg1 {
    [self a_loginInfoDidUpdate:arg1];
}

@end


